Skip to content

Truth Graph: Introducing Levels - #51716

Merged
cmsbuild merged 3 commits into
cms-sw:masterfrom
felicepantaleo:truth-levels-v1
Sep 3, 2026
Merged

Truth Graph: Introducing Levels#51716
cmsbuild merged 3 commits into
cms-sw:masterfrom
felicepantaleo:truth-levels-v1

Conversation

@felicepantaleo

Copy link
Copy Markdown
Contributor

Truth levels stamped on the MC-truth logical graph, so a GEN-SIM-DIGI-RAW production ends with a final, self-describing truth graph. The reco-to-truth association layer will follow in a separate PR. Levels are flags on graph particles: the full history stays navigable, and each level marks the one particle per chain that its denominator counts (for the visible signal final state, the pi0 rather than its two photons).

Commit 1, package policy. Removes the prototype banner from every file that carried it and updates the README: the data model and the levels are now covered by unit tests. No code changes.

Commit 2, SimDataFormats/TruthInfo:

  • levelFlags bitmask on ParticleData, in the alignment hole so sizeof stays 96 (asserted in a unit test).
  • ParticleRole (normal / connector / synthetic stand-in), stored as its underlying type like VertexData::role.
  • Seed pdg ids, reconstructable pdg ids and heavy-flavour seeds recorded on the graph, so every flag is re-derivable from the graph alone.
  • truth::Graph ClassVersion 4 to 5, truth::ParticleData 3 to 4.

Commit 3, PhysicsTools/TruthInfo, the levels. Every level is an antichain (no member is an ancestor of another); on ttbar, 24% of a kinematics-only selection had another selected particle as an ancestor, which is why a plain cut is not a denominator.

  • Levels: hard-scatter legs, generator-stable final state, calorimeter boundary, upstream and underlying-event legs, signal resonance and its visible final state (a pi0 is one object, not two photons), parton-initiated jets (no clustering; the jet is the parton's descendant subgraph, exactly two b jets per ttbar event), first b and first c hadron per chain (B* over B; beauty and charm separate because a B decays to a D).
  • One table declares each level (enum, bit, config name); the lookups, the level list and the cleared mask are derived from it, so adding a level is one row.
  • Walks descend GEN decay vertices only: a SIM continuation is transport, not decay (a K0S interacting in material yields its GEN pions, never the nuclear secondaries).
  • The Signal flag uses the same root computation as the selection, restricted to GEN particles of the signal interaction; a preset naming a decay channel cannot stamp a resonance that decayed the other way. No resonance configured means no signal level, not a degenerate one.

PR validation:

  • Built on CMSSW_20_1_0_pre2; all 9 test suites pass (19 cases in LevelFlags_t), with the association layer absent, so the split is self-contained. Workflow 37634.0 runs end to end on this branch alone.
  • 200 no-PU TenTau events, produced with this branch: 10 signal taus/event, all GEN and signal-interaction. The graph keeps the full decay history (pi0s and their photons, connected); the reconstructableFromSignal denominator marks one entry per chain: 1137 pi0s flagged and none of their photons, no neutrinos, no intermediate resonance (rho, a1) flagged.
  • 10 ttbar PU200 events: all 8 to 12 isHardProcess particles per event belong to the signal interaction, so the flag-driven levels are signal-only in practice; a consumer needing signal-only filters on eventId as the denominator producer does.
  • Flavour-seeded presets: seeds persisted on the graph, two b hadrons flagged per ttbar event.

@IzaakWN @elenavernazza fyi

@cmsbuild

cmsbuild commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51716/50628

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild

Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51716/50629

@cmsbuild

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @felicepantaleo for master.

It involves the following packages:

  • PhysicsTools/TruthInfo (generators)
  • SimDataFormats/TruthInfo (generators)

@cmsbuild, @lviliani, @mkirsano, @sensrcn, @theofil can you please review it and eventually sign? Thanks.
@apsallid, @bsunanda, @denizsun, @fabiocos, @martinamalberti, @missirol, @mmusich, @rovere, @salimcerci this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@felicepantaleo

Copy link
Copy Markdown
Contributor Author

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 288KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fcf517/55383/summary.html
COMMIT: def3d28
CMSSW: CMSSW_20_1_X_2026-08-16-0000/el9_amd64_gcc14
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51716/55383/install.sh to create a dev area with all the needed externals and cmssw changes.

DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3591807
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3591785
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

@cmsbuild

Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51716/50633

@cmsbuild

Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51716/50682

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51716 was updated. @cmsbuild, @lviliani, @mkirsano, @sensrcn, @theofil can you please check and sign again.

@felicepantaleo

Copy link
Copy Markdown
Contributor Author

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 56KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fcf517/55487/summary.html
COMMIT: 3d45d2a
CMSSW: CMSSW_20_1_X_2026-08-20-2300/el9_amd64_gcc14
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51716/55487/install.sh to create a dev area with all the needed externals and cmssw changes.

DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • You potentially removed 1 lines from the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3592269
  • DQMHistoTests: Total failures: 21
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3592230
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

…utions

The data model and the levels are covered by unit tests, so the prototype banner
that closed the packages to external changes comes off every file that carried it.
@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51716 was updated. @cmsbuild, @lviliani, @mkirsano, @sensrcn, @theofil can you please check and sign again.

@felicepantaleo

Copy link
Copy Markdown
Contributor Author

@cmsbuild please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 36KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fcf517/55538/summary.html
COMMIT: c7bcd9c
CMSSW: CMSSW_20_1_X_2026-08-25-1100/el9_amd64_gcc14
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51716/55538/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 2 lines from the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3592269
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3592248
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

@IzaakWN

IzaakWN commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@felicepantaleo, is this ready to reviewed & merged? It would great to have if it can still make it for CMSSW_20_1_0_pre3, so we can use if for the PF tutorial during CMS Week.

@theofil

theofil commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

+1

@cmsbuild

cmsbuild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @ftenchini, @sextonkennedy, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen

Copy link
Copy Markdown
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants